package com.tjise.eduorder.service.impl;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.tjise.eduorder.entity.Order;
import com.tjise.eduorder.mapper.OrderListMapper;
import com.tjise.eduorder.service.OrderListService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

@Service
@Slf4j
public class OrderListServiceImpl extends ServiceImpl<OrderListMapper, Order> implements OrderListService {

    @Override
    public Page<Order> pageListOrder(Long current, Long limit) {
        // 创建Page对象
        Page<Order> pageOrder = new Page<>(current, limit);
        // 调用分页的方法实现分页
        baseMapper.selectPage(pageOrder, null);
        // 返回分页的数据
        log.info("-------------OrderListServiceImpl类中的pageListOrder() 分页的方法 的返回值为： " + pageOrder);
        return pageOrder;
    }

}
